<!DOCTYPE html>
<#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />
<#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
<#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
<html>
<head>
    <meta charset="utf-8">
    <title>质量体系审核员</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .qbdms-TBinformation{margin-left: 0;font-size: 15px}
        .qbdms-TBinformationText{margin-left: 145px;}
    </style>
    <#if isClose == 'true'>
    <style>
        .listBody .qbdms-bodyDiv{padding: 0 }
        body.qbdms-particulars .qbdms-bodyDiv div.layui-table-view-body{padding: 16px}
        .treeFormPreview{position: unset;padding-left: 0!important;}
    </style>
</#if>
</head>
<body class="listBody qbdms-particulars">
<div class="qbdms-bodyDiv" >
    <div class="qbdms-backDiv">
        <div class="layui-table-view-body" style="padding: 0 24px 24px;">
        <#if isClose != 'true'><div class="qbdms-formTitle" style="border-bottom: 1px solid #E5F0FF">质量体系审核员 <i class="qbdms-returnOn closeWindow">返回</i></div></#if>
            <form class="layui-form treeFormPreview" requrl="${ctx}/qbdms/wQbdTeamPeople/get" lay-filter="wQbdTeamPeopleDataForm" >
                <div class="" style="width: 100%;overflow-x: auto">
                    <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                        <tr>
                            <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
                            <td colspan="5"><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">姓名<span style="color: red;">*</span></td>
                            <td colspan="5" name="name"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">性别<span style="color: red;">*</span></td>
                            <td colspan="5"><@dicSelect.dic name="sex" verify="required" nodeKey="zjxb" /></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">民族<span style="color: red;">*</span></td>
                            <td ><@dicSelect.dic name="minzu" verify="required" reqtext="民族是必填项" nodeKey="mz" /></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">籍贯</td>
                            <td colspan="5" name="jiguan"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">工作单位<span style="color: red;">*</span></td>
                            <td colspan="5" name="works"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">身份证号码<span style="color: red;">*</span></td>
                            <td colspan="5" name="idcode"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">出生日期</td>
                            <td colspan="5" name="birthday"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">座机</td>
                            <td colspan="5" name="phone"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">联系方式<span style="color: red;">*</span></td>
                            <td colspan="5" name="contactinformation"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">人员类别<span style="color: red;">*</span></td>
                            <td colspan="5" ><@dicSelect.dic name="peopletype" filter="ry" verify="required" reqtext="人员类别是必填项" nodeKey="rylb" /></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">审核员资格<span style="color: red;">*</span></td>
                            <td colspan="5" name="qualification"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">地址</td>
                            <td colspan="5" name="address"></td>
                        </tr>

                        <tr>
                            <td class="qbdms-zeroTable-lable">备注</td>
                            <td colspan="5" name="remark"></td>
                        </tr>



                        </tbody>
                    </table>
                    <div class="layui-hide">
                        <input type="text" name="id" placeholder="请输入" autocomplete="off"
                               class="layui-input textInput" maxlength="50" fieldname="id">
                        <input type="text" name="worksid" placeholder="请输入工作单位id" autocomplete="off"
                               class="layui-input  textInput" maxlength="50" fieldname="worksid">
                        <input type="text" name="transstatus" placeholder="请输入transstatus" autocomplete="off"
                               class="layui-input  textInput" maxlength="50" fieldname="transstatus">
                        <input type="text" name="eventlever" placeholder="请输入eventlever" autocomplete="off"
                               class="layui-input  textInput" maxlength="50" fieldname="eventlever">
                        <@dicSelect.dic  id="zlgl" nodeKey="shyzgzl" />
                        <@dicSelect.dic  id="zljy" nodeKey="shyzgjy" />
                        <@dicSelect.dic  id="shy" nodeKey="shyzgsh" />
                    </div>
                </div>
                <#if isClose != 'true'>
                <div class="layui-form-item btnformItem">
                    <p>
                        <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
                    </p>
                </div>
            </#if>
            </form>
        </div>
        </div>

</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>

    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','setter', 'propsHandle', 'laydate', 'jquery','commonDialog', 'common','publicMethods','qbdmsForm'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var common = layui.common;
        var form = layui.qbdmsForm;
        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }

        var propsHandle = layui.propsHandle;
        var defProps = {
            //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
            viewMould: 'moulds/', // 组件模块 存放文件 *****
            selectorBtn: '.selectorBtn'
        };
        var temQuery = new propsHandle();
        // 初始化模板功能
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });

        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = '${ctx}/qbdms/wQbdTeamPeople/view/list';
        });

        form.on('select(ry)', function (data) {
            setQualifications(data.value);
        });
        function setQualifications(key){
            if (key === "质量管理") {
                $("#qualifications").html($("#zlgl").html());
            } else if (key === "质量检验") {
                $("#qualifications").html($("#zljy").html());
            } else if (key === "审核员") {
                $("#qualifications").html($("#shy").html());
            }
            form.render('select');
        }

        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        $(function () {
            $("input[name='idcode']").on("input", function (e) {
                if (e.delegateTarget.value.length > 14) {
                    var birthday = "";
                    if(e.delegateTarget.value != null && e.delegateTarget.value !== ""){
                        if(e.delegateTarget.value.length === 15){
                            birthday = "19"+e.delegateTarget.value.substr(6,6);
                        } else if(e.delegateTarget.value.length === 18){
                            birthday = e.delegateTarget.value.substr(6,8);
                        }

                        birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-");
                    }
                    $("input[name='birthday']").val(birthday);
                } else {
                    $("input[name='birthday']").val("");
                }
            });
        });

        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name: 'wQbdTeamPeopleDataForm',
            idValue: "${id}",
            primary: "id",
            getCallback: function (data) {
                $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span>" +
                    "<span class='qbdms-TBinformationText'>【"+data.data.filldept+"   | "+data.data.fillman+"  | "+data.data.filldate+"】</span>");
                setQualifications(data.data.peopletype);
            }
        });

        $("body *").not("#closeWindow").attr("disabled","disabled");
    });
</script>
</body>
</html>